package com.atguigu.lease.common.util;

public class ValidateUtil {

    public static void phoneValidate(String phone){
        String pattern = "^((13[0-9])|(14[5,7,9])|(15[0-3]|[5-9])|(16[5,6])|(17[0-8])|(19[1,5,8,9]))\\d{8}$";
        boolean matches = phone.matches(pattern);
        if(!matches){
            //手机号格式不正确
            throw new RuntimeException("手机号格式错误");
        }
    }

}
